Skip to content

Conversation

migmartri
Copy link
Member

@migmartri migmartri commented Dec 12, 2023

This patch enables API-token management though the CLI as well as implements its use in the controlplane.

An API-token is an alternative authentication method compared to the temporary user auth.

  • [API] Load/validate API tokens in middleware alongside regular user auth tokens
  • [API] Implement API handlers for the creation, revocation and listing of API tokens in the client
  • [CLI] Add support to providing the token in the CLI via flag --token or env var CHAINLOOP_API_TOKEN
  • [CLI] Add support for creation, revocation and listing of tokens in the CLI

Closes #351
Closes #453

Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
@migmartri migmartri marked this pull request as ready for review December 12, 2023 23:01
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Copy link

@danoo danoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the call and reviewing it together. LGTM! Please add an issue to make sure we track the user who created it. And also can we extract the revokedAt validation to a separated method?

Copy link
Member

@danlishka danlishka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the call and reviewing it together. LGTM! Please add an issue to make sure we track the user who created it. And also can we extract the revokedAt validation to a separated method?

Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
@migmartri migmartri merged commit df8e477 into chainloop-dev:main Dec 15, 2023
@migmartri migmartri deleted the api-token-api branch December 15, 2023 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Controlplane API tokens support Service account support
3 participants